<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script type="text/javascript" src="/js/jquery-1.8.2.js"></script>
<script type="text/javascript" src="/layui/layui.all.js"></script>
<link rel="stylesheet" href="/layui/css/layui.css">
<body>
<i style="font-size:50px; color: black" class="layui-icon layui-icon-location">维修记录表</i>
<form class="layui-form">
    <div class="layui-collapse">
        <div class="layui-colla-item">

            <div class="layui-form-item">
                <div class="layui-colla-item">
                    <h2 class="layui-colla-title">故障信息</h2>
                    <div class="layui-colla-content layui-show">

                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label" style="background-color: #ececec">故障类型</label>
                            <div class="layui-input-inline">
                                <input type="text" name="type" placeholder="请输入具体故障类型" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="background-color: #ececec">是否为内部维修</label>
                            <div class="layui-input-block">
                                <input type="radio" name="interior" value="1" title="内部维修">
                                <input type="radio" name="interior" value="2" title="外部维修" checked>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="background-color: #ececec">有无使用内部配置零件</label>
                            <div class="layui-input-block">
                                <input type="radio" name="part" value="1" title="有">
                                <input type="radio" name="part" value="2" title="无" checked>
                            </div>
                        </div>

                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label" style="background-color: #ececec">故障细节</label>
                            <div class="layui-input-block">
                                <textarea name="detail" placeholder="请具体叙述下资产的损坏类型、原因，"
                                          class="layui-textarea"></textarea>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">资产信息</h2>
                <div class="layui-colla-content layui-show">

                    <div class="layui-form-item">
                        <label class="layui-form-label" style="background-color: #ececec">资产责任人</label>

                        <div class="layui-input-inline">
                            <div class="layui-input-inline">
                                <input type="text" th:value="${responsible}" name="responsible" class="layui-input">
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" style="background-color: #ececec">资产编号</label>
                        <div class="layui-input-inline">
                            <input type="text" id="propertyId" th:value="${property_id}" name="property_id"
                                   class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label" style="background-color: #ececec">资产名称</label>
                        <div class="layui-input-inline">
                            <input type="text" id="" th:value="${property_name}" name="property_name"
                                   class="layui-input">
                        </div>
                    </div>

                </div>
            </div>

        </div>
    </div>
    </div>
</form>
<button class="layui-btn" type="button" onclick="javascript:addd()">立即提交</button>
<button class="layui-btn" onclick="insertMaintain()">返回</button>
</body>
<script type="text/javascript">

    //Demo
    layui.use(['form', 'element'], function () {
        var form = layui.form;
        var element = layui.element;

        form.render();
        /*  //监听提交
          form.on('submit(formDemo)', function(data){
          layer.msg(JSON.stringify(data.field));
          return false;
      });*/
    });


    //添加维修申请
    function addd() {
        var dataForm = $("form").serialize();
        console.log(dataForm)
        // return false;
        $.post("/scrap/record?" + dataForm, function (data) {
            alert(data);
            window.location.href = "/jump/goScrapIndex";
        },)
    }


    //返回维修单页面
    function insertMaintain() {
        location.href = "/jump/goScrapIndex"
    }
</script>
</html>